#include <iostream>
#include<vector>
using namespace std;

int main() {
    int n;
    cin >> n;
    vector<vector<int>>ans(n);
    for (int i = 0; i < n; i++) {
        ans[i].resize(i + 1);
        ans[i][0] = ans[i][i] = 1;

        for (int pos = 1; pos < i; pos++) {
            ans[i][pos] = ans[i - 1][pos - 1] + ans[i - 1][pos];
        }

    }
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < ans[i].size(); j++) {
            printf("%5d", ans[i][j]);
        }
        printf("\n");
    }

    return 0;

}
